<template>
	<view style="color: #fff;">
		<uni-popup ref="popup" type="top">
			<view class="flex flex-column" style="height: 100vh;">
				<view @click="closePopup" class="">
					<view class="status_bar">

					</view>
					<view class="nav_bar">
					</view>
					<view class="py-3">
						<view class="" style="height:34rpx;">

						</view>
					</view>
				</view>
				<view class="popupWrap flex-1 A-Medium" style="overflow-y: scroll;"
					:class="model=='light'?'popupWrapLight':''">
					<view @click="confirm(item)" v-for="(item,index) in list" class="list mx-3 py-3"
						:class="model=='light'?'listLight':''">
						{{item.title}}
					</view>
					<view class="" style="height: 68rpx;">

					</view>
				</view>
			</view>
		</uni-popup>
	</view>

</template>

<script>
	import {
		getWithdrawStatusList,
		getTransferStatusList,
		rechargeRecharge_status
	} from '@/core/api/index.js';
	import {
		commissionTradeType,
		bill_type,
		inviteRewardTradeType
	} from '@/core/api/user.js';
	export default {
		name: "ztPoup",
		props: {
			type: {
				type: Number,
				default: 1, //1提现状态 2划转状态 3充值状态 4佣金记录类型 5账单 6推广奖励7现货订单8套利订单9期权订单
			}
		},
		created() {
			if (this.type == 1) {
				getWithdrawStatusList({}).then(res => {
					let list = res.result;
					this.list = list;
				})
			}
			if (this.type == 2) {
				getTransferStatusList({}).then(res => {
					let list = res.result;
					this.list = list;
				})
			}
			if (this.type == 3) {
				rechargeRecharge_status({}).then(res => {
					let list = res.result;
					this.list = list;
				})
			}
			if (this.type == 4) {
				commissionTradeType({}).then(res => {
					let list = res.result;
					this.list = list;
				})
			}
			if (this.type == 5) {
				bill_type({}).then(res => {
					this.list = [
						{
							value: '',
							title: '全部'
						}
					]
					let list = res.result;
					this.list.push(...list);
				})
			}
			if (this.type == 6) {
				inviteRewardTradeType({}).then(res => {
					let list = res.result;
					this.list = list;
				})
			}
			if (this.type == 7) {
				// inviteRewardTradeType({}).then(res=>{
				// 	let list = res.result;
				// 	this.list = list;
				// })
				this.list = [
					{
						value: '',
						title: '全部订单'
					},
					{
						value: 'buy',
						title: '买入订单'
					},
					{
						value: 'sell',
						title: '卖出订单'
					},
				]
			}
			if (this.type == 8) {
				// inviteRewardTradeType({}).then(res=>{
				// 	let list = res.result;
				// 	this.list = list;
				// })
				this.list = [
					{
						value: '',
						title: '全部订单'
					},
					{
						value: '1',
						title: '待处理订单'
					},
					{
						value: '2',
						title: '已完成订单'
					},
				]
			}
			if (this.type == 9) {
				// inviteRewardTradeType({}).then(res=>{
				// 	let list = res.result;
				// 	this.list = list;
				// })
				this.list = [
					{
						value: '',
						title: '全部订单'
					},
					{
						value: 'Bullish',
						title: '看涨订单'
					},
					{
						value: 'Bearish',
						title: '看跌订单'
					},
					{
						value: 'Single',
						title: '看单订单'
					},
					{
						value: 'Plural',
						title: '看双订单'
					},
				]
			}
		},
		data() {
			return {
				list: []
			};
		},
		computed: {
			i18n() {
				return this.$t('component');
			},
			model() {
				return this.$store.state.config.model;
			}
		},
		methods: {
			open() {
				this.$refs.popup.open('top');
			},
			confirm(e) {
				this.$emit('confirm', e);
				this.closePopup();
			},
			closePopup() {
				this.$refs.popup.close();
			},
		}
	}
</script>

<style scoped lang="scss">
	.popupWrap {
		background: #0E0F11;
		font-size: 32rpx;
		color: #F7F7F7;

		.titleWrap {
			margin-bottom: 6rpx;

			image {
				width: 36rpx;
				height: 36rpx;
			}
		}

		.list {
			border-bottom: 2rpx solid #1F2128;
		}

		.listLight {
			border-bottom: 2rpx solid #F4F4F4;
		}
	}

	.popupWrapLight {
		background: #ffffff;
		color: #0E0F11;
	}
</style>